]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Re-add the hotcorner when the panel is updated
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 17 Feb 2013 04:28:29 +0000 (23:28 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 18 Feb 2013 19:42:44 +0000 (14:42 -0500)
The activities button may come and go at any moment now that we
have a dynamic panel. We need to re-check the activities button
whenever the panel is updated.

https://bugzilla.gnome.org/show_bug.cgi?id=694038

js/ui/main.js
js/ui/messageTray.js

index e493a90bbe28f22d56df58deac6882c655a04e63..ae0754a0827cc392cba83a61daa3ac0b8cf958d6 100644 (file)
@@ -131,6 +131,9 @@ function start() {
         screenShield = new ScreenShield.ScreenShield();
     else
         screenShield = new ScreenShield.ScreenShieldFallback();
+
+    // The message tray relies on being constructed
+    // after the panel.
     panel = new Panel.Panel();
     messageTray = new MessageTray.MessageTray();
     keyboard = new Keyboard.Keyboard();
index 28ec5f37d046b76bc1c187a270a39dd5dbebc7d1..ce721361e3441eac24894286813f365165b3e814 100644 (file)
@@ -1651,8 +1651,6 @@ const MessageTray = new Lang.Class({
                                                      { keybindingMode: Shell.KeyBindingMode.MESSAGE_TRAY });
         this._grabHelper.addActor(this._summaryBoxPointer.actor);
         this._grabHelper.addActor(this.actor);
-        if (Main.panel.statusArea.activities)
-            this._grabHelper.addActor(Main.panel.statusArea.activities.hotCorner.actor);
 
         Main.layoutManager.connect('keyboard-visible-changed', Lang.bind(this, this._onKeyboardVisibleChanged));
 
@@ -1707,6 +1705,8 @@ const MessageTray = new Lang.Class({
                 this._updateState();
             }));
 
+        // Track if we've added the activities button
+        this._activitiesButtonAdded = false;
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
 
         Main.wm.addKeybinding('toggle-message-tray',
@@ -1802,6 +1802,11 @@ const MessageTray = new Lang.Class({
     },
 
     _sessionUpdated: function() {
+        if (!this._activitiesButtonAdded && Main.panel.statusArea.activities) {
+            this._activitiesButtonAdded = true;
+            this._grabHelper.addActor(Main.panel.statusArea.activities.hotCorner.actor);
+        }
+
         if ((Main.sessionMode.isLocked || Main.sessionMode.isGreeter) && this._inCtrlAltTab) {
             Main.ctrlAltTabManager.removeGroup(this._summary);
             this._inCtrlAltTab = false;